docs(web/blog): fix Adobe-breaking top-level var in from-wirebox-to-wheelsdi DI example#3235
Conversation
…heelsdi services.cfm example The `config/services.cfm` snippet used a top-level `var di = injector();`. A bare top-level `var` statement compile-errors on Adobe CF (#3063) — `config/services.cfm` is an included template, not a function body, so `var` isn't valid there on Adobe. Lucee/BoxLang tolerate it, but the example as shipped breaks for Adobe readers who copy it. Switch to the cross-engine-safe `local.di` form (matching the DI guide and CLAUDE.md), and update the chained references to `local.di.*`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Peter Amiri <petera@pai.com>
There was a problem hiding this comment.
Wheels Bot — Reviewer
TL;DR — This docs-only PR fixes a config/services.cfm code example in the From WireBox to wheelsdi blog post, swapping a bare top-level var di = injector(); (and its chained .map()/.bind() references) for the cross-engine-safe local.di form. A bare var statement in an included template — which config/services.cfm is, not a function body — compile-errors on Adobe CF (#3063), so the snippet as shipped broke for any Adobe reader who copied it. The change is correct, complete, and matches the established convention. Verdict: approve.
Correctness
The fix is complete and internally consistent: all four lines (injector(), two .map() chains, one .bind() chain) now use local.di, leaving nothing stale. Verified against the file — web/content/blog/posts/from-wirebox-to-wheelsdi.md:49-52 is now uniformly local.di.*, and a grep for var di in the file returns nothing.
Conventions
The new form matches the canonical convention used everywhere else in the repo:
CLAUDE.md:453—local.di = injector();web/sites/guides/.../digging-deeper/dependency-injection-usage.mdx:30and the rest of the v4-0-0 guides
So the blog post no longer contradicts the guides or the agent reference. As the PR body notes, the guides were already clean — this was the lone stray occurrence.
Commits
The single commit fa8d6abb6 — docs(web/blog): use local.di (not top-level var) in from-wirebox-to-wheelsdi services.cfm example — is a valid conventional-commit header at 97 chars (within the 100 limit), correct docs type, optional unrestricted scope. The PR title (87 chars) is likewise valid and is the squash-merge landing subject.
No changelog fragment is required: changelog.d/ is for user-facing framework fix/feat changes, not blog-content corrections.
Clean, well-scoped, verifiable. Nice catch on the Adobe-breaking snippet.
What
The published post From WireBox to Wheels DI has a
config/services.cfmcode example using a top-levelvar di = injector();. A bare top-levelvarstatement compile-errors on Adobe CF (#3063) —config/services.cfmis an included template, not a function body, sovarisn't valid there on Adobe. Lucee/BoxLang tolerate it, but the snippet as shipped breaks for any Adobe reader who copies it.Switched to the cross-engine-safe
local.diform (matching the DI guide and CLAUDE.md), and updated the chained.map()/.bind()references tolocal.di.*.How this surfaced
Found during the Wheels 4.0 blog-series validation campaign. A validator claimed "the published guides ship the same
var diform" — I verified, and the guides are actually clean (they already uselocal.di). The real occurrence was this one published blog post. The admin DB row (id 878) has been updated to match.Content-only change to one blog
.md; no executable code paths touched.